<?php

/*
 * This file is part of the Geek-Zoo Projects.
 * 
 * @copyright (c) 2010 Geek-Zoo Projects More info http://www.geek-zoo.com
 * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License
 * @author quqiang <quqiang@geek-zoo.com>
 *
 */


class cooper_abs 
{
	public $cooper_user_id = '';
	
    function __construct($action, $method)
    {
        if (!isset($_SESSION['admin_user'])) {
            redirect('?url=user/login');
        }
				
   		$menu =  Config::get('cooper_menu');
		if ($_SESSION['admin_user']['is_cooper'] == '1') {
			$this->cooper_user_id = $_SESSION['admin_user']['id'];
		} elseif (isset($_SESSION['admin_user']['cooper_id'])) {
			$cooper_id = $_SESSION['admin_user']['cooper_id'];
			$this->cooper_user_id = $cooper_id;
		}
        $this->action = $action;
        Smarty3::instance()->assign('admin_action', $action);
        Smarty3::instance()->assign('menu', $menu);
        Smarty3::instance()->assign('menu_action', $action);
    }

}

?>